Skip to content

Conversation

Duologic
Copy link
Contributor

What this PR does / why we need it:

The family generator creates a family per GVK, this requires that the
configuration has a unique HELP text per custom metric. This is not
feasible when using wildcards as the generate will reuse the same HELP
text for each GVK it finds.

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)

It does not change cardinality but does change the HELP text on metrics generated by CustomResourceState.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2384, fixes #2453

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 24, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 24, 2025
@mrueg
Copy link
Member

mrueg commented Mar 28, 2025

/assign @rexagod

@CatherineF-dev
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 31, 2025
@Duologic
Copy link
Contributor Author

@rexagod Anything I can do to help here?

Copy link
Member

@rexagod rexagod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrueg Do you see this as a breaking change? We don't offer any guarantees and such on the metric metadata, as such, the metrics stability framework only applies to a metrics' label-set, but this may still break things for the user (unofficial use-cases with grepping, etc.). Additionally, this makes the user hard opt-into a custom HELP text.

@@ -90,10 +90,13 @@ func compileFamily(f Generator, resource Resource) (*compiledFamily, error) {
if errorLogV == 0 {
errorLogV = resource.ErrorLogV
}

help := fmt.Sprintf("%s for %s/%s/%s", f.Help, resource.GroupVersionKind.Group, resource.GroupVersionKind.Version, resource.GroupVersionKind.Kind)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 13, 2025
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CatherineF-dev, Duologic

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 13, 2025
@Duologic Duologic requested a review from rexagod May 20, 2025 13:10
@Duologic
Copy link
Contributor Author

@rexagod Anything I can help to get this merged?

@mrueg
Copy link
Member

mrueg commented Aug 15, 2025

change looks pretty straight forward.

@Duologic can you push again to trigger CI? for some reason it didn't run.

@rexagod any thoughts?

@Duologic Duologic force-pushed the duologic/wildcard_duplicates_removed branch from c556dcd to 2e19a83 Compare August 21, 2025 14:20
@Duologic
Copy link
Contributor Author

rebased.

@github-project-automation github-project-automation bot moved this to Needs Triage in SIG Instrumentation Aug 26, 2025
@rexagod rexagod moved this from Needs Triage to Needs Review in SIG Instrumentation Aug 27, 2025
The family generator creates a family per GVK, this requires that the
configuration has a unique HELP text per custom metric. This is not
feasible when using wildcards as the generate will reuse the same HELP
text for each GVK it finds.
@Duologic Duologic force-pushed the duologic/wildcard_duplicates_removed branch from 2e19a83 to ebf0fdb Compare August 27, 2025 22:21
@Duologic
Copy link
Contributor Author

rebased and fixed unit test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
Status: Needs Review (PR) or Response (Issue)
Development

Successfully merging this pull request may close these issues.

kube-state-metrics doesn't produce metric for Custom Resources Custom resource state metrics wildcard not working
5 participants